home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
e
/
misc.txt
/
000050_jaltman2@nyc.rr.com_Thu Dec 28 12:33:51 2006.msg
< prev
next >
Wrap
Internet Message Format
|
2018-01-01
|
2KB
Path: reader2.panix.com!reader1.panix.com!panix!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!post02.iad01!roadrunner.com!not-for-mail
Message-ID: <4592EB8D.2050307@nyc.rr.com>
Date: Wed, 27 Dec 2006 16:54:21 -0500
From: Jeffrey Altman <jaltman2@nyc.rr.com>
Organization: Send private replies to jaltman at mit dot edu
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: comp.protocols.kermit.misc
Subject: Re: ftp check usage
References: <1166820118.724272.114490@80g2000cwy.googlegroups.com> <slrneooln8.grv.fdc@panix3.panix.com> <1167229694.435877.237650@48g2000cwx.googlegroups.com> <45928c3e$0$4877$4c368faf@roadrunner.com> <1167238425.623478.174680@48g2000cwx.googlegroups.com>
In-Reply-To: <1167238425.623478.174680@48g2000cwx.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Lines: 39
X-Complaints-To: abuse@rr.com
Xref: panix comp.protocols.kermit.misc:15622
There definitely is a bug here. FTP CHECK <file> is implemented as:
case FTP_CHK: /* Check if remote file(s) exist(s) */
if ((x = cmtxt("remote filename", "", &s, xxstring)) < 0)
return(x);
CHECKCONN();
success = remote_files(1,(CHAR *)s,NULL,0) ? 1 : 0;
return(success);
The problem is that remote_files() returns a CHAR * not a success
or failure value.
In this case, because no pattern parameter is being specified,
the return value is a pointer to the static buffer containing
/bin/ls: tst: No such file or directory
This is because in remote_files() the NLST case doesn't handle
the situation where the server returns an error string instead
of the file name.
if (mgetmethod == SND_NLS) { /* NLST... */
if (pattern) {
if (!ckmatch((char *)pattern,p,(servertype == SYS_UNIX),1))
goto again;
}
}
The end result is that the non-NULL return is being treated as
a success value.
This could be fixed by treating by using the 'arg' as the 'pattern'
in the NLST case if 'pattern' is not specified or by passing in
'arg' as the 'pattern' into the remote_files() call in the FTP_CHK
block.
Jeffrey Altman
Secure Endpoints Inc.